<?php
echo "<center><a href='".$PHP_SELF."?func=add'>".$locale['ctbs014']."</a></center>";
$result = dbquery("SELECT * FROM ".$db_prefix."charts ORDER BY 'vote' DESC");
if (dbrows($result) != 0)
{
echo "<table width='100%' class='tbl-border' cellspacing='1'>
<tr>
    <td class='tbl2'><b>".$locale['ctbs003']."</b></td>
    <td class='tbl2'><b>".$locale['ctbs004']."</td></b>
    <td class='tbl2'><b>".$locale['ctbs005']."</td></b>
    <td class='tbl2'><b>".$locale['ctbs006']."</td></b>
    <td class='tbl2'><b>".$locale['ctbs022']."</td></b>
</tr>";
$x = 0;
while ($data = dbarray($result))
{
  $x++;
  $votes = $data['vote'];
  echo"
  <tr>
    <td class='tbl1'>".$x.".</td>
    <td class='tbl1'>".$votes."</td>
    <td class='tbl1'>".$data['artist']."</td>
    <td class='tbl1'>".$data['title']."</td>
    <td class='tbl1'><a href='".$PHP_SELF."?func=del&delid=".$data['id']."'>".$locale['ctbs024']."</a> | <a href='".$PHP_SELF."?func=edit&editid=".$data['id']."'>".$locale['ctbs023']."</a></td>
  </tr>";
}
}
else
{
  echo $locale['ctbs015'];
}
echo "</table>";
?>
